import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: 花海
 * Date: 2022-07-30
 * Time: 8:51
 */
public class NumberOfOne {
    //输入一个整数,求的他在内存中存储的二进制1的个数

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);



        while (sc.hasNextInt()) {
            int num = sc.nextInt();
            int flag = 32;
            int sum = 0;
            while (flag != 0) {
                if ((num & 1) == 1) {
                    sum++;
                }
                num = num >>> 1;
                flag--;

            }
            System.out.println(sum);
        }
    }
}
